@extends('user.base_guest')
@section('title', '注册')
@section('content')
<div class="layui-container dhbwl-marginTop">
    <div class="dhbwl-panel dhbwl-panel-user" pad20>
        <div class="layui-tab layui-tab-brief" lay-filter="user">
            <ul class="layui-tab-title">
                <li><a href="{{route('login')}}">登入</a></li>
                <li class="layui-this">注册</li>
            </ul>
            <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form layui-form-pane">
                        <form method="post" action="{{route('register')}}">
                            <div class="layui-form-item">
                                <label  class="layui-form-label">用户名</label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="username"  class="layui-input" value="{{old('username')}}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label  class="layui-form-label">邮箱</label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="email" class="layui-input" value="{{ old('email') }}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">密码</label>
                                <div class="layui-input-inline">
                                    <input type="password"  name="password"  class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">确认密码</label>
                                <div class="layui-input-inline">
                                    <input type="password"  name="password_confirmation"  class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label  class="layui-form-label">手机号</label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="mobile" class="layui-input" value="{{ old('mobile') }}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">验证码</label>
                                <div class="layui-input-inline">
                                    <input type="text"  name="captcha"  class="layui-input">
                                </div>
                                <div class="layui-form-mid" style="padding: 0!important;">
                                    <img src="{{Captcha::src('edu')}}" height="38" onclick="this.src='{{Captcha::src('edu')}}?'+Math.random()">
                                </div>
                            </div>{{csrf_field()}}
                            <div class="layui-form-item">
                                <button class="layui-btn dhbwl-bg-blue layui-btn-normal" lay-filter="*" lay-submit>立即登录</button>
                                <span style="padding-left:20px;">
                  <a href="{{route('password.request')}}">忘记密码？</a>
                </span>
                            </div>
                            <div class="layui-form-item dhbwl-form-app">
                                <span>或者使用社交账号登入</span>
                                <a href="" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})" class="iconfont icon-qq" title="QQ登入"></a>
                                <a href="" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})" class="iconfont icon-weibo" title="微博登入"></a>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@include('user._footer')
<script src="/static/js/layui/layui.all.js"></script>
<script>
    layui.use(['form'], function () {
        var form = layui.form,
            layer = layui.layer;
        var allError = "";
        @if ($errors->any())
            @foreach ($errors->all() as $error)
            allError += "{{$error}}<br/>";
        @endforeach
        layer.alert(allError, {
            icon: 2,
            title: '错误信息',
            skin: 'layui-layer-molv' //样式类名
            , closeBtn: 0
        });
        @endif
    });
</script>
@endsection
